<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Fetch all the SNMP objects from an agent</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.snmp3-set.html">snmp3_set</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.snmpget.html">snmpget</a></div>
 <div class="up"><a href="ref.snmp.html">SNMP 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.snmp3-walk" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">snmp3_walk</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">snmp3_walk</span> &mdash; <span class="dc-title">Fetch all the <acronym title="Simple Network Management Protocol">SNMP</acronym> objects from an agent</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.snmp3-walk-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>snmp3_walk</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$host</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$sec_name</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$sec_level</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$auth_protocol</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$auth_passphrase</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$priv_protocol</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$priv_passphrase</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$object_id</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$timeout</code><span class="initializer"> = 1000000</span></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$retries</code><span class="initializer"> = 5</span></span>
  ]] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>snmp3_walk()</strong></span> function is used to read all the values from
   an <acronym title="Simple Network Management Protocol">SNMP</acronym> agent specified by the <em><code class="parameter">hostname</code></em>. 
  </p>
  <p class="para">
   Even if the security level does not use an auth or priv protocol/password valid values have to be specified.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.snmp3-walk-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">host</code></em></dt>

    <dd>

     <p class="para">
      The hostname of the SNMP agent (server).
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">sec_name</code></em></dt>

    <dd>

     <p class="para">
      the security name, usually some kind of username
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">sec_level</code></em></dt>

    <dd>

     <p class="para">
      the security level (noAuthNoPriv|authNoPriv|authPriv)
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">auth_protocol</code></em></dt>

    <dd>

     <p class="para">
      the authentication protocol (MD5 or SHA)
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">auth_passphrase</code></em></dt>

    <dd>

     <p class="para">
      the authentication pass phrase
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">priv_protocol</code></em></dt>

    <dd>

     <p class="para">
      the privacy protocol (DES or AES)
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">priv_passphrase</code></em></dt>

    <dd>

     <p class="para">
      the privacy pass phrase
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">object_id</code></em></dt>

    <dd>

     <p class="para">
      If <strong><code>NULL</code></strong>, <em><code class="parameter">object_id</code></em> is taken as the root of
      the <acronym title="Simple Network Management Protocol">SNMP</acronym> objects tree and all objects under that tree are returned as
      an array. 
     </p>
     <p class="para">
      If <em><code class="parameter">object_id</code></em> is specified, all the <acronym title="Simple Network Management Protocol">SNMP</acronym> objects
      below that <em><code class="parameter">object_id</code></em> are returned.
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">timeout</code></em></dt>

    <dd>

     <p class="para">
      The number of microseconds until the first timeout.
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">retries</code></em></dt>

    <dd>

     <p class="para">
      The number of times to retry if timeouts occur.
     </p>
    </dd>

   
  </dl>

 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.snmp3-walk-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an array of <acronym title="Simple Network Management Protocol">SNMP</acronym> object values starting from the
   <em><code class="parameter">object_id</code></em> as root or <strong><code>FALSE</code></strong> on error.
  </p>
 </div>

 
 
 <div class="refsect1 examples" id="refsect1-function.snmp3-walk-examples">
  <h3 class="title">范例</h3>
  <p class="para"> 
   <div class="example" id="example-4472">
    <p><strong>Example #1 <span class="function"><strong>snmp3_walk()</strong></span> Example</strong></p>
    <div class="example-contents"> 
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$ret&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">snmp3_walk</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'james'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'authPriv'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'SHA'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'secret007'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'AES'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'secret007'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'IF-MIB::ifName'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_export</span><span style="color: #007700">(</span><span style="color: #0000BB">$ret</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p> 
  <p class="para">
   Above function call would return all the <acronym title="Simple Network Management Protocol">SNMP</acronym> objects from the
   <acronym title="Simple Network Management Protocol">SNMP</acronym> agent running on localhost:
<div class="cdata"><pre>      
array (
  0 =&gt; &#039;STRING: lo&#039;,
  1 =&gt; &#039;STRING: eth0&#039;,
  2 =&gt; &#039;STRING: eth2&#039;,
  3 =&gt; &#039;STRING: sit0&#039;,
  4 =&gt; &#039;STRING: sixxs&#039;,
)
</pre></div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.snmp3-walk-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.snmp3-real-walk.html" class="function" rel="rdfs-seeAlso">snmp3_real_walk()</a> - Return all objects including their respective object ID within the specified one</span></li>
   </ul>
  </p>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.snmp3-set.html">snmp3_set</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.snmpget.html">snmpget</a></div>
 <div class="up"><a href="ref.snmp.html">SNMP 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
